package com.mygame.common.msg;


import java.util.HashMap;
import java.util.Map;

public enum ServiceEnum {
    GAME_GATE_WAY(1001,"GAME_GATE_WAY"),
    GAME_LOGIC(101,"GAME_LOGIC"),
    GAME_ARENA(102,"GAME_ARENA"),
    CLIENT(100,"CLIENT"),
    ;

    public int id;
    public String cmdName;


    public static Map<Integer, ServiceEnum> cmdMap = new HashMap<>();
    static {
        for(ServiceEnum cmd : ServiceEnum.values()){
            cmdMap.put(cmd.id, cmd);
        }
    }

    ServiceEnum(int id, String cmd) {
        this.cmdName = cmd;
        this.id = id;
    }

    public static ServiceEnum find(int cmdId){
        return cmdMap.get(cmdId);
    }

}
